package com.ib.review.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ib.review.pojo.dto.CompareParam;
import com.ib.review.pojo.dto.CompareRoleParam;
import com.ib.review.pojo.po.CompareRulePO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CompareRuleMapper extends BaseMapper<CompareRulePO> {
    @Select("select heading from td_compare_rule where record_id = #{recordId} and rule_type = #{ruleType} and del_flag = 0")
    String queryRule(CompareParam param);

    @Select("select * from td_compare_rule where record_id = #{recordId} and rule_type = #{ruleType} and del_flag = 0")
    CompareRulePO queryRuleById(@Param("recordId") String recordId, @Param("ruleType") int ruleType);

    void updateRoleContent(CompareRoleParam param);

    @Select("select file_name from td_compare_rule where record_id = #{recordId} and del_flag = 0")
    List<String> queryFileName(@Param("recordId") String recordId);
}
